#
# @lc app=leetcode.cn id=26 lang=python
#
# [26] 删除排序数组中的重复项
#

# @lc code=start
class Solution(object):
    def removeDuplicates(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        i = 0
        while i < len(nums)-1:
            if nums[i] == nums[i+1]:
                nums.pop(i+1)
            else:
                i += 1
        print(nums)
        return len(nums)
# @lc code=end


if __name__ == "__main__":
    solution = Solution()
    length = solution.removeDuplicates([1, 1, 1])
    print(length)
